<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateWechatUsersTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nickname', 30)->default('');
            $table->string('openid', 50)->default('');
            $table->string('unionid', 50)->default('');
            $table->unsignedTinyInteger('sex')->default(0);
            $table->string('language', 10)->default('');
            $table->string('city', 30)->default('');
            $table->string('province', 30)->default('');
            $table->string('country', 30)->default('');
            $table->string('headimgurl', 200)->default('');
            $table->unsignedTinyInteger('subscribe')->default(0);
            $table->integer('subscribe_time')->default(0);
            $table->integer('status')->nullable()->default(1);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('wechat_users');
    }
}
